# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=jekyll
_gemname=jekyll
pkgver=4.3.3
pkgrel=0
pkgdesc="A blog-aware static site generator in Ruby"
url="https://jekyllrb.com/"
arch="noarch"
license="MIT"
# Dependencies specified in jekyll.gemspec. Keep in sync!
_gemspec_depends="$depends
	ruby-addressable~=2
	ruby-colorator~=1
	ruby-em-websocket~=0
	ruby-i18n~=1
	ruby-jekyll-sass-converter<=4
	ruby-jekyll-watch~=2
	ruby-kramdown>=2.3.1
	ruby-kramdown-parser-gfm~=1
	ruby-liquid~=4
	ruby-mercenary<=0.5
	ruby-pathutil~=0
	ruby-rouge<=5.0
	ruby-safe_yaml~=1
	ruby-terminal-table<=4.0
	"
depends="ruby-$_gemname=$pkgver-r$pkgrel"
_depends_ruby="
	ruby
	ruby-webrick
	ruby-bundler
	$_gemspec_depends
	"
makedepends="$_depends_ruby"
subpackages="ruby-$_gemname:_ruby"
source="https://github.com/jekyll/jekyll/archive/v$pkgver/jekyll-$pkgver.tar.gz
	gemspec.patch
	"
options="!check"  # FIXME: tests require extra dependencies

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions
}

_ruby() {
	depends="$_depends_ruby"

	amove usr/lib/ruby
}

sha512sums="
af3f82d172e187f2d279d8d50b69dedb384ad6d199f5e1feec7eecdfd7f6c78f43c4adc041757e2747800a12ca3ce1c084d462916ad83bb82c0281dd000dc1c2  jekyll-4.3.3.tar.gz
5c67bc5e90fbd1283687cff1cc01491de842d4235b277658aefbbdac88b3b7d104e1293de177b5c41eace4a04433ad4ba333efebde4ad85bb0f9b6663b414e4b  gemspec.patch
"
